package com.yang.concurrency.chapter3;

/**
 * @Author: 血魔
 * @Date: Created in 14:41 2021/12/12
 * @Version: $
 */
public class CreateThread04 {

    static int counter = 1;

    public static void main(String[] args) {
        new Thread(null,new Runnable() {
            @Override
            public void run() {
                try{
                    add(1);
                } catch (Error e) {
                    System.out.println(counter);
                }
            }

            private void add (int i){
                counter++;
                add(i+1);
            }
        }, "陈瑾玉", 1 << 24 ).start();
    }
}
